package com.glodon.paas.document.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.glodon.paas.document.dao.domain.ShareEntity;

/**
 * @author wangc-f
 */
public interface ShareDao extends DBDao<ShareEntity, String> {

    static Logger logger = LoggerFactory.getLogger(ShareDao.class);

    /**
     * @param userId
     * @param fileId
     * @return
     */
    List<ShareEntity> getShareForMe(String userId, String fileId);

    // /**
    // * @param userId
    // * @return
    // */
    // List<ShareEntity> getShareForMe(String userId);

    /**
     * @param userId
     * @param fileId
     * @param shareType
     * @return
     */
    List<ShareEntity> getShareByMe(String userId, String fileId, Integer shareType);

    // /**
    // * @param userId
    // * @return
    // */
    // List<ShareEntity> getShareByMe(String userId);

    /**
     * @param fileId
     * @return
     */
    boolean isSharedFile(String fileId);

    /**
     * @param fileId
     * @return
     */
    boolean isPublishedFile(String fileId);

    /**
     * @param fileId
     * @param shareType
     * @return
     */
    long getShareCount(String fileId, Integer shareType);

    /**
     * @param fileId
     * @param excludeUserId
     */
    void deleteByFile(String fileId, Integer shareType);

    /**
     * @param ownerId
     */
    void deleteByOwner(String ownerId);
}
